/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author 王宇
* @date 2023-12-29
**/
@Entity
@Data
@Table(name="dis_order")
public class DisOrder implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "order_id")
    @ApiModelProperty(value = "主键id")
    private Long orderId;

    @Column(name = "order_no")
    @ApiModelProperty(value = "订单编号")
    private String orderNo;

    @Column(name = "order_type")
    @ApiModelProperty(value = "订单类型0：身份，1：课程")
    private Integer orderType;

    @Column(name = "nick_name")
    @ApiModelProperty(value = "昵称")
    private String nickName;

    @Column(name = "real_name")
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    @Column(name = "mobile")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    @Column(name = "open_id")
    @ApiModelProperty(value = "openid")
    private String openId;

    @Column(name = "parent_open_id")
    @ApiModelProperty(value = "上级openid")
    private String parentOpenId;

    @Column(name = "order_amount")
    @ApiModelProperty(value = "订单金额")
    private BigDecimal orderAmount;

    @Column(name = "commission")
    @ApiModelProperty(value = "佣金")
    private BigDecimal commission;

    @Column(name = "biz_order_no")
    @ApiModelProperty(value = "分佣业务订单号")
    private String bizOrderNo;

    @Column(name = "biz_open_id")
    @ApiModelProperty(value = "分佣业务openId")
    private String bizOpenId;

    @Column(name = "biz_order_title")
    @ApiModelProperty(value = "分佣业务名称")
    private String bizOrderTitle;

    /*@Column(name = "biz_nick_name")
    @ApiModelProperty(value = "分佣业务用户昵称")
    private String bizNickName;

    @Column(name = "biz_real_name")
    @ApiModelProperty(value = "分佣业务用户真实姓名")
    private String bizRealName;

    @Column(name = "biz_mobile")
    @ApiModelProperty(value = "分佣业务名称")
    private String bizMobile;*/

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    public void copy(DisOrder source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}